<template>
		<view class="item_layout">
			<navigator :url="'/pages/classifyItem/classifyItem?id='+item._id+'&name='+item.name" class="box" v-if="isshow">
				<image class="img" :src="item.picurl"></image>
				<view  class="mask">{{item.name}}</view>
				<view  class="tag">{{formatTimeDiff(item.updateTime)}}前更新</view>
			</navigator>
			
			<navigator url="/pages/classify/classify" open-type="reLaunch" class="box more" v-else>
				<image class="img" src="../../common/images/6.png"></image>
				<view  class="mask">
					<uni-icons type="more" size="35"  color="#fff"></uni-icons>
					<text>更多</text>
				</view>
			</navigator>
		</view>
</template>

<script  setup>
import {formatTimeDiff} from '@/utils/date.js'
let pros=defineProps({
	isshow:Boolean,
	item:{
		type:Object,
		default(){
			return {
				
				name:'明星美女',
			    picurl:'../../common/images/6.png',
				updateTime:Date.now()-1000*60*60*60*24*4
			}
		}
	} 
	})
	  // console.log(parseInt(Date.now()/1000/ 60 / 60 / 24));
	
</script>

<style lang="scss" scoped>
  .item_layout{
	   // padding: 50rpx 0rpx;
	  .box{
		    height:340rpx;
			border-radius: 10rpx;
			overflow: hidden;
			position: relative;
			.img{
				width: 100%;
				height: 100%;
	        }
			.mask{
				width:100%;
				height: 60rpx;
				// line-height: 60rpx;
				// text-align: center;
				display: flex;
                align-items: center;
				justify-content: center;
				background: rgba(0, 0, 0, 0.2);
				backdrop-filter: blur(20rpx);
				position: absolute;
				bottom: 0;
				left: 0;
				color: #fff;
				font-weight: 700;	
			}
			.tag{
				position: absolute;
				top: 0;
				left: 0;
				color: #fff;
				background-color: red;
				border-radius:0rpx 0rpx 10rpx 0rpx ;
				font-size: 24rpx;
				padding: 4rpx;
				transform: scale(0.8);
				transform-origin: left top;
			}
	    }
		.box.more{
			.mask{
				width: 100%;
			    height: 100%;
				flex-direction:column;
			}
			
		}
	}
 
</style>